package spec.lijunyao.unit4.outclazz.aimal;

import java.util.Date;

public class Frog extends Animal implements IAnimal {
    // 成员属性
    public String liangQi;
    // 构造方法
    public Frog() {
    }

    public Frog(String name, String food, String area, String lq) {
        super(name, food, area);
        this.liangQi = lq;
    }

    // 成员方法
    @Override
    public String born() {
        String n = super.getName();
        Date d = new Date();
        return n + "出生于" + d;
    }

    @Override
    public String old() {
        return  super.name + "变老了";
    }

    @Override
    public String sick() {
        return super.name + "生病了";
    }

    @Override
    public String die() {
        return super.name + "死掉了";
    }

    @Override
    String findFood() {
        return super.name + "找" + super.food;
    }

    @Override
    String wholeLife() {
        String b = this.born();
        String f = this.findFood();
        String e = this.eat();
        String o = this.old();
        String s = this.sick();
        String d = this.die();
        return b + "\n" + f + "\\n" + e + "\n" + o + "\\\n" + s + "\n" + d;
    }
}